<!DOCTYPE html>
<html>
<head>
<meta content="text/html;charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>个人中心</title>
<link rel="stylesheet"
	th:href="@{/common/js/miniui/res/font-awesome/css/font-awesome.min.css}" />
<link rel="stylesheet" th:href="@{/plugins/layui/css/layui.css}"/>
 <script th:src="@{/plugins/layui/layui.js}" type="text/javascript"></script>
 <style type="text/css">
 	.layui-input, .layui-textarea {
	    display: block;
	    width: 90%;
	    padding-left: 10px;
	}
 
 </style>

</head>
<body>
	<div class="layui-tab layui-tab-card" >
	  <ul class="layui-tab-title">
	    <li class="layui-this">基本资料</li>
	    <li>修改头像</li>
	    <li>修改密码</li>
	  </ul>
	  <div class="layui-tab-content" style="height: 320px;">
	    <div class="layui-tab-item layui-show">
		    	<fieldset class="layui-elem-field layui-field-title" style="margin-top: 0px;">
				  <legend style="font-size: 14px">基本信息</legend>
				</fieldset>
				<div style="margin-left: 60px;margin-top: -5px;margin-bottom: 15px;">
				  <span style="color: #f00">*&nbsp;</span>真实姓名：<span class="hidden-xs" style="font-family: 微软雅黑;font-size: 14px;" th:text="${user.name}"></span>
				  <br></br>
				  <br></br>
				  <span style="color: #f00">*&nbsp;</span>登录账号：<span class="hidden-xs" style="font-family: 微软雅黑;font-size: 14px;" th:text="${user.username}"></span>
				   <br></br>
				  <br></br>
				  <span style="color: #f00">*&nbsp;</span><span class="hidden-xs" style="font-family: 微软雅黑;font-size: 14px;" th:text="${user.regTime}?${'注册日期：' +  #dates.format(user.regTime, 'yyyy-MM-dd')}:'注册日期：-'"></span>
				</div> 
				<fieldset class="layui-elem-field layui-field-title" style="margin-top: 0px">
					  <legend style="font-size: 14px;">机构信息</legend>
				</fieldset>
	    		<div style="margin-left: 60px;margin-top: -5px;margin-bottom: 10px;">
				  <span style="color: #f00">*&nbsp;</span>所在政区：<span class="hidden-xs" style="font-family: 微软雅黑;font-size: 14px;" th:text="${user.fwRightOrg.orgFullname}"></span>
				  <br></br>
				  <br></br>
				  <span style="color: #f00">*&nbsp;</span>政区编码：<span class="hidden-xs" style="font-family: 微软雅黑;font-size: 14px;" th:text="${user.fwRightOrg.orgCode}"></span>
				     <br></br>
				  <br></br>
				   <span style="color: #f00">*&nbsp;</span>&nbsp;联 系 人：<span class="hidden-xs" style="font-family: 微软雅黑;font-size: 14px;" th:text="${user.fwRightOrg.linkMan}"></span>
				   <br></br>
				  <br></br>
				   <span style="color: #f00">*&nbsp;</span>联系电话：<span class="hidden-xs" style="font-family: 微软雅黑;font-size: 14px;" th:text="${user.fwRightOrg.linkPhone}"></span>
				</div> 
	    
	    </div>
	    <div class="layui-tab-item">
	    		
	    		<fieldset class="layui-elem-field layui-field-title" style="margin-top: 0px;">
				  <legend style="font-size: 14px">修改头像</legend>
				</fieldset>
				
				<div class="layui-upload">
				  <button type="button" class="layui-btn" id="test1">上传头像</button>
				  <div class="layui-upload-list">
				    <img class="layui-upload-img" id="demo1" th:src="@{/downloadforlayui}" ></img>
				    <p id="demoText"></p>
				  </div>
				</div>   
	    		
	    
	    </div>
	    <div class="layui-tab-item">
	    	
	    	<form class="layui-form" action="" >
				  <div class="layui-form-item" style="margin-top: 15px;">
				    <label class="layui-form-label">旧密码</label>
				    <div class="layui-input-block">
				      <input type="password" name="password" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input"></input>
				    </div>
				  </div>
				  <div class="layui-form-item">
				    <label class="layui-form-label">新密码</label>
				    <div class="layui-input-block">
				      <input type="password" name="repass1"  lay-verify="pass" placeholder="请输入" autocomplete="off" class="layui-input"></input>
				    </div>
				  </div>
				  <div class="layui-form-item">
				    <label class="layui-form-label">确认密码</label>
				    <div class="layui-input-block">
				      <input type="password" name="repass2" lay-verify="pass" placeholder="请输入" autocomplete="off" class="layui-input"></input>
				    </div>
				  </div>
				   <div class="layui-form-item">
				    <div class="layui-input-block">
				      <button class="layui-btn" lay-submit="" lay-filter="demo1">确认修改</button>
				      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
				    </div>
				  </div>
			</form>
	    
	    </div>
	  </div>
	</div>
</body>
<script th:inline="javascript" type="text/javascript">
 /*<![CDATA[*/
 	
 	
	 
	var basePath = /*[[@{/}]]*/

	var layer=null;
	
	layui.use(['upload','form','layer','element'], function(){
		  var form = layui.form;
		  var $ = layui.jquery
		  ,element = layui.element,
		   layer = layui.layer,
		   upload = layui.upload;; //Tab的切换功能，切换事件监听等，需要依赖element模块

		  form.verify({
			    pass: [/(.+){6,18}$/, '密码必须6到18位']
			    ,content: function(value){
			      layedit.sync(editIndex);
			    }
			  });

		//监听提交
		  form.on('submit(demo1)', function(data){
		    /* layer.alert(JSON.stringify(data.field), {
		      title: '最终的提交信息'
		    }) */
		    layer.msg('暂 不 开 放。 。 。');
		    return false;
		  });


		//普通图片上传
		  var uploadInst = upload.render({
		    elem: '#test1'
		    ,url: basePath+'uploadforlayui'
		    ,size: 100
		    ,before: function(obj){
		      //预读本地文件示例，不支持ie8
		      obj.preview(function(index, file, result){
		        $('#demo1').attr('src', result); //图片链接（base64）
		      });
		    }
		    ,done: function(res){
		      //如果上传失败
		      if(res.status == "true"){
			      parent.setImg();
		    	   return layer.msg('上传成功');
		      }else{
			        return layer.msg(res.data+'上传失败');
			  }
		      //上传成功
		    }
		    ,error: function(){
		      //演示失败状态，并实现重传
		      var demoText = $('#demoText');
		      demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
		      demoText.find('.demo-reload').on('click', function(){
		        uploadInst.upload();
		      });
		    }
		  });
		  
		  
		  
	});



 
 
 /*]]>*/
</script>
</html>